<#assign tit><#if _oper='add'>新增<#else>修改</#if>门店</#assign>
<@page.html title=tit>
<script>
  function chgns(sl) {
    var pic = sl.options[sl.selectedIndex].getAttribute("spic");
    getEl("fm_input").sealPic.value = pic;
    getEl("sp_seal").innerHTML = pic?('<img src="'+pic+'" width="150" />'):'';
  }
</script>
<div style="width:450px;">

  <form id="fm_input" method="post" action="<#if _oper='add'>_add<#else>_edit</#if>" onsubmit="return post(this);">
    <div class="kbox">
      <table class="input">
        <tr>
          <th width="25%">编号</th>
          <td width="75%"><#if _oper='add'><input type="text" name="code" value="${shop.code!}" req="编号" size="16" maxlength="20"><span class="require">*</span><#else><input type="hidden" name="code" value="${shop.code!}">${shop.code!}</#if></td>
        </tr>
        <tr>
          <th>名称</th>
          <td><input type="text" name="chName" value="${shop.chName!}" req="名称" size="26" maxlength="50"><span class="require">*</span></td>
        </tr>
        <tr>
          <th>类型</th>
          <td><select name="shopType"><#if shopType??><#list shopType as t><option value="${t.id}"<#if shop.shopType?? && shop.shopType=t.id> selected</#if>>${t.name}</option></#list></#if></select></td>
        </tr>
        <tr>
          <th>级别</th>
          <td><select name="levelCode" style="width:150px;"><option value=""></option><#if shopLevel??><#list shopLevel as t><option value="${t.id}"<#if shop.levelCode?? && shop.levelCode=t.id> selected</#if>>${t.name}</option></#list></#if></select></td>
        </tr>
        <tr>
          <th>地区</th>
          <td><select name="areaType"><option value=""></option><#if areaType??><#list areaType as t><option value="${t.id}"<#if shop.areaType?? && shop.areaType=t.id> selected</#if>>${t.name}</option></#list></#if></select></td>
        </tr>
        <tr>
          <th>地址</th>
          <td><input type="text" name="address" value="${shop.address!}" size="36" maxlength="80"></td>
        </tr>
        <tr>
          <th>电话</th>
          <td><input type="text" name="phone" value="${shop.phone!}" size="20" maxlength="20"></td>
        </tr>
        <tr>
          <th>联系人</th>
          <td><input type="text" name="linkman" value="${shop.linkman!}" size="20" maxlength="20"></td>
        </tr>
        <tr>
          <th>传真</th>
          <td><input type="text" name="fax" value="${shop.fax!}" size="20" maxlength="20"></td>
        </tr>
        <tr>
          <th>公司法人名称</th>
          <td><select name="companyName" onchange="chgns(this);"><option value="" spic="">--请选择--</option><#if shopNameSeal??><#list shopNameSeal as t><option value="${t.name}" spic="${t.prop}"<#if shop.companyName?? && shop.companyName=t.name> selected</#if>>${t.name}</option></#list></#if></select></select></td>
        </tr>
        <tr>
          <th>公章图片</th>
          <td><input type="hidden" name="sealPic" value="${shop.sealPic!}"><span id="sp_seal"><#if shop.sealPic?? && shop.sealPic?length!=0><img src="${shop.sealPic!}" width="150" /></#if></span></td>
        </tr>
        <tr>
          <th>合同版式</th>
          <td><select name="contractStyle"><#if contractStyle??><#list contractStyle as t><option value="${t.id}"<#if shop.contractStyle?? && shop.contractStyle=t.id> selected</#if>>${t.name}</option></#list></#if></select></td>
        </tr>
        <tr>
          <th>状态</th>
          <td><input type="radio" name="status" id="enable_1" value="1"<#if shop.status=1> checked</#if>><label for="enable_1">正常</label>
            <input type="radio" name="status" id="enable_2" value="2"<#if shop.status!=1> checked</#if>><label for="enable_2">关店</label></td>
        </tr>
        <tr>
          <th>排序</th>
          <td><input type="text" name="sort" value="${shop.sort!}" req="排序号" size="5" maxlength="4"></td>
        </tr>
        <tr>
          <th></th>
          <td><input type="checkbox" name="makeCard" id="makeCard" value="1"<#if shop.makeCard=1> checked</#if>><label for="makeCard">制卡</label>
            <input type="checkbox" name="needPaperContract" id="needPaperContract" value="1"<#if shop.needPaperContract=1> checked</#if>><label for="needPaperContract">需要纸质合同</label></td>
        </tr>
      </table>
    </div>
    <div class="button"><input type="submit" value="提 交"></div>
  </form>
</div>
</@page.html>